package com.llh.cheap.forms;

import jakarta.validation.constraints.NotNull;
import lombok.Data;
import top.moirae.core.AbstractOption;
import top.moirae.core.Column;
import top.moirae.core.QueryColumn;
import top.moirae.core.Table;

public interface CheapUserForm {

    @Data
    @Table(name = "cheap_user")
    class Create {
        @Column
        @NotNull(message = "加盟商用户id不能为空")
        private Long userId; // 加盟商用户id 
        @Column
        private Long bossId; // 老板id 
        @Column
        private String wechatName; // 微信名称 
        @Column
        private String customerNumber; // 平台客服工号 
        @Column
        private String qxtCode; // 千讯通用户绑定code 
        @Column
        private String qxtShare; // 千讯通分享码url 
        @Column
        private String qxtAccount; // 千迅通账号 
        @Column
        private String qxtPassword; // 千迅通密码 
        @Column
        private String employeeNumber; // 员工工号 
        @Column
        private String recommendName; // 推荐人名称

        @Column(nullable = true)
        public AbstractOption<String> getWechatName() {
            return AbstractOption.apply(wechatName);
        }
    }

    @Data
    class Search {
        private Long id;
        private Long userId; // 加盟商用户id
        private Long bossId; // 老板id
        private String wechatName; // 微信名称
        private String customerNumber; // 平台客服工号
        private String qxtCode; // 千讯通用户绑定code
        private String qxtShare; // 千讯通分享码url
        private String qxtAccount; // 千迅通账号
        private String qxtPassword; // 千迅通密码
        private String employeeNumber; // 员工工号
        private String recommendName; // 推荐人名称

        @QueryColumn(alias = "cu", method = QueryColumn.Method.EQ)
        public AbstractOption<Long> getUserId() {
            return AbstractOption.apply(userId);
        }

        @QueryColumn(alias = "cu", method = QueryColumn.Method.LIKE)
        public AbstractOption<String> getWechatName() {
            return AbstractOption.apply(wechatName);
        }

    }

    @Data
    @Table(name = "cheap_user")
    class Update {
        @Column
        private Long id;
        @Column
        @NotNull(message = "加盟商用户id不能为空")
        private Long userId; // 加盟商用户id 
        @Column
        private Long bossId; // 老板id 
        @Column
        private String wechatName; // 微信名称 
        @Column
        private String customerNumber; // 平台客服工号 
        @Column
        private String qxtCode; // 千讯通用户绑定code 
        @Column
        private String qxtShare; // 千讯通分享码url 
        @Column
        private String qxtAccount; // 千迅通账号 
        @Column
        private String qxtPassword; // 千迅通密码 
        @Column
        private String employeeNumber; // 员工工号 
        @Column
        private String recommendName; // 推荐人名称 

        @Column(nullable = true)
        public AbstractOption<String> getWechatName() {
            return AbstractOption.apply(wechatName);
        }

    }

}

